PROJECT(infer_demo C CXX)
CMAKE_MINIMUM_REQUIRED (VERSION 3.10)
# specify the decompress directory of FastDeploy SDK
option(FASTDEPLOY_INSTALL_DIR "Path of downloaded fastdeploy sdk.")
include(${FASTDEPLOY_INSTALL_DIR}/utils/gflags.cmake)
include(${FASTDEPLOY_INSTALL_DIR}/FastDeploy.cmake)
include_directories(${FASTDEPLOY_INCS})

add_executable(benchmark ${PROJECT_SOURCE_DIR}/benchmark.cc)
add_executable(benchmark_yolov5 ${PROJECT_SOURCE_DIR}/benchmark_yolov5.cc)
add_executable(benchmark_ppyolov5 ${PROJECT_SOURCE_DIR}/benchmark_ppyolov5.cc)
add_executable(benchmark_ppyolov6 ${PROJECT_SOURCE_DIR}/benchmark_ppyolov6.cc)
add_executable(benchmark_ppyolov7 ${PROJECT_SOURCE_DIR}/benchmark_ppyolov7.cc)
add_executable(benchmark_ppyolov8 ${PROJECT_SOURCE_DIR}/benchmark_ppyolov8.cc)
add_executable(benchmark_ppyolox ${PROJECT_SOURCE_DIR}/benchmark_ppyolox.cc)
add_executable(benchmark_ppyoloe ${PROJECT_SOURCE_DIR}/benchmark_ppyoloe.cc)
add_executable(benchmark_picodet ${PROJECT_SOURCE_DIR}/benchmark_picodet.cc)
add_executable(benchmark_ppcls ${PROJECT_SOURCE_DIR}/benchmark_ppcls.cc)
add_executable(benchmark_ppseg ${PROJECT_SOURCE_DIR}/benchmark_ppseg.cc)
add_executable(benchmark_ppmatting ${PROJECT_SOURCE_DIR}/benchmark_ppmatting.cc)
add_executable(benchmark_ppocr_det ${PROJECT_SOURCE_DIR}/benchmark_ppocr_det.cc)
add_executable(benchmark_ppocr_cls ${PROJECT_SOURCE_DIR}/benchmark_ppocr_cls.cc)
add_executable(benchmark_ppocr_rec ${PROJECT_SOURCE_DIR}/benchmark_ppocr_rec.cc)
add_executable(benchmark_structurev2_table ${PROJECT_SOURCE_DIR}/benchmark_structurev2_table.cc)
add_executable(benchmark_structurev2_layout ${PROJECT_SOURCE_DIR}/benchmark_structurev2_layout.cc)
add_executable(benchmark_ppyoloe_r ${PROJECT_SOURCE_DIR}/benchmark_ppyoloe_r.cc)
add_executable(benchmark_ppyoloe_r_sophgo ${PROJECT_SOURCE_DIR}/benchmark_ppyoloe_r_sophgo.cc)
add_executable(benchmark_ppyolo ${PROJECT_SOURCE_DIR}/benchmark_ppyolo.cc)
add_executable(benchmark_yolov3 ${PROJECT_SOURCE_DIR}/benchmark_yolov3.cc)
add_executable(benchmark_fasterrcnn ${PROJECT_SOURCE_DIR}/benchmark_fasterrcnn.cc)
add_executable(benchmark_maskrcnn ${PROJECT_SOURCE_DIR}/benchmark_maskrcnn.cc)
add_executable(benchmark_ssd ${PROJECT_SOURCE_DIR}/benchmark_ssd.cc)
add_executable(benchmark_rtmdet ${PROJECT_SOURCE_DIR}/benchmark_rtmdet.cc)
add_executable(benchmark_cascadercnn ${PROJECT_SOURCE_DIR}/benchmark_cascadercnn.cc)
add_executable(benchmark_fcos ${PROJECT_SOURCE_DIR}/benchmark_fcos.cc)
add_executable(benchmark_gfl ${PROJECT_SOURCE_DIR}/benchmark_gfl.cc)
add_executable(benchmark_retinanet ${PROJECT_SOURCE_DIR}/benchmark_retinanet.cc)
add_executable(benchmark_tood ${PROJECT_SOURCE_DIR}/benchmark_tood.cc)
add_executable(benchmark_ttfnet ${PROJECT_SOURCE_DIR}/benchmark_ttfnet.cc)
add_executable(benchmark_ppdet ${PROJECT_SOURCE_DIR}/benchmark_ppdet.cc)
add_executable(benchmark_dino ${PROJECT_SOURCE_DIR}/benchmark_dino.cc)
add_executable(benchmark_ppshituv2_rec ${PROJECT_SOURCE_DIR}/benchmark_ppshituv2_rec.cc)
add_executable(benchmark_ppshituv2_det ${PROJECT_SOURCE_DIR}/benchmark_ppshituv2_det.cc)

if(UNIX AND (NOT APPLE) AND (NOT ANDROID))
  target_link_libraries(benchmark ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_yolov5 ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_ppyolov5 ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_ppyolov6 ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_ppyolov7 ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_ppyolov8 ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_ppyolox ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_ppyoloe ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_ppyoloe_r ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_ppyoloe_r_sophgo ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_picodet ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_ppcls ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_ppseg ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_ppmatting ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_ppocr_det ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_ppocr_cls ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_ppocr_rec ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_structurev2_table ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_structurev2_layout ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_ppyolo ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_yolov3 ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_fasterrcnn ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_maskrcnn ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_ssd ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_rtmdet ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_cascadercnn ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_fcos ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_gfl ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_retinanet ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_tood ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_ttfnet ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_ppdet ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_dino ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_ppshituv2_rec ${FASTDEPLOY_LIBS} gflags pthread)
  target_link_libraries(benchmark_ppshituv2_det ${FASTDEPLOY_LIBS} gflags pthread)
else()
  target_link_libraries(benchmark ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_yolov5 ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_ppyolov5 ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_ppyolov6 ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_ppyolov7 ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_ppyolov8 ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_ppyolox ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_ppyoloe ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_ppyoloe_r ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_ppyoloe_r_sophgo ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_picodet ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_ppcls ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_ppseg ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_ppmatting ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_ppocr_det ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_ppocr_cls ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_ppocr_rec ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_structurev2_table ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_structurev2_layout ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_ppyolo ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_yolov3 ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_fasterrcnn ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_maskrcnn ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_ssd ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_rtmdet ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_cascadercnn ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_fcos ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_gfl ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_retinanet ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_tood ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_ttfnet ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_ppdet ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_dino ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_ppshituv2_rec ${FASTDEPLOY_LIBS} gflags)
  target_link_libraries(benchmark_ppshituv2_det ${FASTDEPLOY_LIBS} gflags)
endif()
# only for Android ADB test
if(ANDROID)
  install_fastdeploy_libraries(${CMAKE_CURRENT_BINARY_DIR})
endif()
